package com.bana.fvs.model;

import java.sql.Time;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Calendar;
import java.util.Date;
import java.util.List;

/**
 * 雾区重复方案
 */
public class Program {

    private int fabm;
    private String famc;
    private int faxq;
    private int sfsy;
    private int wqbm;
    private Time kssj;
    private int cxsj;

    private int kzcl;
    private int wdlddj;
    private int sspl;
    private int zkb;

    private int wdkz;
    private int wdld;
    private int ldsc;
    private int mdsc;
    private int hdys;
    private int mqys;
    private int hsjsdzsl;


    //扩展字段
    private String wdkzsm;
    private String sfsysm;
    private List<Integer> faxqjh;
    private String kssjsm;
    private String kzclsm;
    private String ssplsm;
    private String zkbsm;
    private String wdlddjsm;

    //以下方法并不是默认的
    public String getJssjsm() {
        return new SimpleDateFormat("HH:mm").format(getJssj());
    }
    public Date getJssj() {

        if(this.kssj==null)
        {
            return new Date();
        }
        else
        {
            Calendar calendar=Calendar.getInstance();
            calendar.setTime(kssj);
            calendar.add(Calendar.MINUTE,this.cxsj);
            return calendar.getTime();
        }
    }
    public List<Integer> getFaxqjh()
    {
        faxqjh =new ArrayList<>();
        if((faxq&0x01)!=0)
        {
            faxqjh.add(1);
        }
        if((faxq&0x02)!=0)
        {
            faxqjh.add(2);
        }
        if((faxq&0x04)!=0)
        {
            faxqjh.add(3);
        }
        if((faxq&0x08)!=0)
        {
            faxqjh.add(4);
        }
        if((faxq&0x10)!=0)
        {
            faxqjh.add(5);
        }
        if((faxq&0x20)!=0)
        {
            faxqjh.add(6);
        }
        if((faxq&0x40)!=0)
        {
            faxqjh.add(7);
        }
        return faxqjh;
    }
    public void setFaxqjh(List<Integer> faxqjh) {

        int week=0;
        for(int i = 0; i< faxqjh.size(); ++i)
        {
            switch (faxqjh.get(i))
            {
                case 1:
                    week=week|0x01;
                    break;
                case 2:
                    week=week|0x02;
                    break;
                case 3:
                    week=week|0x04;
                    break;
                case 4:
                    week=week|0x08;
                    break;
                case 5:
                    week=week|0x10;
                    break;
                case 6:
                    week=week|0x20;
                    break;
                case 7:
                    week=week|0x40;
                    break;
            }
        }
        this.faxq=week;
    }

    //end


    public int getWdlddj() {
        return wdlddj;
    }

    public void setWdlddj(int wdlddj) {
        this.wdlddj = wdlddj;
    }

    public int getFaxq() {
        return faxq;
    }

    public void setFaxq(int faxq) {
        this.faxq = faxq;
    }

    public int getSfsy() {
        return sfsy;
    }

    public void setSfsy(int sfsy) {
        this.sfsy = sfsy;
    }

    public int getWqbm() {
        return wqbm;
    }

    public void setWqbm(int wqbm) {
        this.wqbm = wqbm;
    }

    public int getWdkz() {
        return wdkz;
    }

    public void setWdkz(int wdkz) {
        this.wdkz = wdkz;
    }

    public Time getKssj() {
        return kssj;
    }

    public void setKssj(Time kssj) {
        this.kssj = kssj;
    }

    public int getFabm() {
        return fabm;
    }

    public void setFabm(int fabm) {
        this.fabm = fabm;
    }

    public int getWdld() {
        return wdld;
    }

    public void setWdld(int wdld) {
        this.wdld = wdld;
    }

    public int getLdsc() {
        return ldsc;
    }

    public void setLdsc(int ldsc) {
        this.ldsc = ldsc;
    }

    public int getMdsc() {
        return mdsc;
    }

    public void setMdsc(int mdsc) {
        this.mdsc = mdsc;
    }

    public int getHdys() {
        return hdys;
    }

    public void setHdys(int hdys) {
        this.hdys = hdys;
    }

    public int getMqys() {
        return mqys;
    }

    public void setMqys(int mqys) {
        this.mqys = mqys;
    }

    public int getHsjsdzsl() {
        return hsjsdzsl;
    }

    public void setHsjsdzsl(int hsjsdzsl) {
        this.hsjsdzsl = hsjsdzsl;
    }

    public String getWdkzsm() {
        return wdkzsm;
    }

    public void setWdkzsm(String wdkzsm) {
        this.wdkzsm = wdkzsm;
    }

    public String getFamc() {
        return famc;
    }

    public void setFamc(String famc) {
        this.famc = famc;
    }


    public int getCxsj() {
        return cxsj;
    }

    public void setCxsj(int cxsj) {
        this.cxsj = cxsj;
    }

    public String getKssjsm() {
        return kssjsm;
    }

    public void setKssjsm(String kssjsm) {
        this.kssjsm = kssjsm;
    }

    public String getSfsysm() {
        return sfsysm;
    }

    public void setSfsysm(String sfsysm) {
        this.sfsysm = sfsysm;
    }

    public int getKzcl() {
        return kzcl;
    }

    public void setKzcl(int kzcl) {
        this.kzcl = kzcl;
    }

    public int getSspl() {
        return sspl;
    }

    public void setSspl(int sspl) {
        this.sspl = sspl;
    }

    public int getZkb() {
        return zkb;
    }

    public void setZkb(int zkb) {
        this.zkb = zkb;
    }

    public String getKzclsm() {
        return kzclsm;
    }

    public void setKzclsm(String kzclsm) {
        this.kzclsm = kzclsm;
    }

    public String getSsplsm() {
        return ssplsm;
    }

    public void setSsplsm(String ssplsm) {
        this.ssplsm = ssplsm;
    }

    public String getZkbsm() {
        return zkbsm;
    }

    public void setZkbsm(String zkbsm) {
        this.zkbsm = zkbsm;
    }

    public String getWdlddjsm() {
        return wdlddjsm;
    }

    public void setWdlddjsm(String wdlddjsm) {
        this.wdlddjsm = wdlddjsm;
    }
}
